<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang='zh-cn'>
<head>
  <meta charset='utf-8'>
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <title>用户登录 - 上海舜谷</title>
<script language='Javascript'>var config={"webRoot":"\/shungu\/","appName":"","cookieLife":30,"requestType":"PATH_INFO","requestFix":"-","moduleVar":"m","methodVar":"f","viewVar":"t","defaultView":"html","themeRoot":"\/shungu\/theme\/","currentModule":"user","currentMethod":"login","clientLang":"zh-cn","requiredFields":"","router":"\/shungu\/index.php","save":"\u4fdd\u5b58","runMode":"","timeout":30000,"pingInterval":""};
var lang={"submitting":"\u7a0d\u5019...","save":"\u4fdd\u5b58","timeout":"\u8fde\u63a5\u8d85\u65f6\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u73af\u5883\uff0c\u6216\u91cd\u8bd5\uff01"};

</script>
<script src='js/all.js?=0.1.1' type='text/javascript'></script>
<link rel='stylesheet' href='css/zh-cn.default.css?v=0.1.1' type='text/css' media='screen' />
<style>#featurebar ul.nav li .chosen-container a.chosen-single{background:#F8FAFE; border:none; -webkit-box-shadow:none;box-shadow:none; padding-top:5px;}
#featurebar ul.nav li .chosen-container .chosen-drop {min-width: 200px;!important}
#dept_chosen.chosen-container .chosen-drop {min-width: 400px;!important}
body{background-color: #036}
#container{margin: 10% auto 0 auto}
#login-panel{margin: 0 auto;width: 540px;min-height: 280px;background-color: #fff;border: 1px solid #dfdfdf;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px;-moz-box-shadow:0px 0px 30px rgba(0,0,0,0.75); -webkit-box-shadow:0px 0px 30px rgba(0,0,0,0.75); box-shadow:0px 0px 30px rgba(0,0,0,0.75)}
#login-panel .panel-head{min-height: 70px;background-color: #edf3fe;border-bottom: 1px solid #dfdfdf;position: relative}
#login-panel .panel-head h4{margin: 0 0 0 20px;padding: 0;line-height: 70px; font-size: 14px}
#login-panel .panel-actions{float: right;position: absolute;right: 15px;top: 18px;padding: 0}
#login-panel .panel-actions .dropdown {display: inline-block; margin-right: 2px}
#mobile {font-size: 28px; padding: 1px 12px; line-height: 28px}
#mobile i {font-size: 28px;}
#login-panel .panel-content{padding-left: 150px;background:url('theme/default/images/main/sg-logo.png') 50px top no-repeat; min-height: 161px}
#login-panel .panel-content table{border: none;width: 300px;margin: 20px auto}
#login-panel .panel-content .button-s{width: 80px}
#login-panel .panel-content .button-c{width: 88px;margin-right: 0}
#login-panel .panel-foot{text-align: center;padding: 15px;line-height: 2em;background-color: #e5e5e5;border-top: 1px solid #dfdfdf}
#poweredby{float: none; color: #eee;text-align: center;margin: 10px auto}
#poweredby a{color: #fff}
#keeplogin label {font-weight: normal}
.popover {max-width: 500px}
.popover-content {padding: 0; width: 297px}
.btn-submit {min-width: 70px}

.body-modal #container {margin: 0;}
.body-modal {padding: 40px 0 25px;}
</style><link rel='icon' href='' type='' />
<link rel='shortcut icon' href='' type='' />
<script type="text/javascript"> 
		function testPassword(){
			var a1 = document.getElementById("a1").value;
			var a2 = document.getElementById("a2").value;
			if(a1!=a2){
				alert("密码输入不正确，请重新输入。");
			}
		}
</script>
<script type="text/javascript">
		function checkmobile(){
			var obj = document.getElementById("mobile");
			var form1 = document.getElementById("form1");
			if(!/^1\d{10}$/.test(obj.value)){
				alert("请输入正确的手机号码！");
			}else{
				form1.submit();
			}
		}
</script>

</head>
<body>
<script src='js/md5.js?v=0.1.1' type='text/javascript'></script>
<div id='container'>
  <div id='login-panel'>
    <div class='panel-head'>
      <h4>上海舜谷项目管理系统</h4>
    </div>
    <div class="panel-content" id="login-form">
      <form action="register" method="post" id="form1">
   			<table border="1">
   				<tr>
   					<td>用户名:</td>
   					<td><input type="text" name="name"/></td>
   				</tr>
   			   	<tr>
   					<td>密&nbsp;码:</td>
   					<td><input type="password" name="password" id="a1"/></td>
   				</tr>
   				<tr>
   					<td>确认密码:</td>
   					<td><input type="password" id="a2"/></td>
   				</tr>
   				<tr>
   					<td>性&nbsp;别:</td>
   					<td><input type="radio"  name="sex" value="男" />男<input type="radio"  name="sex" value="女"/>女</td>
   				</tr>
   				<tr>
   					<td>手机号:</td>
   					<td><input type="text" name="phone" id="mobile"/></td>
   				</tr>
   				<tr>
   					<td>身&nbsp;份:</td>
   					<td><input type="radio"  name="power" value="1"/>公司管理员<input type="radio"  name="power" value="2"/>公司普通用户</td>
   				</tr>
   				<tr>
   					<td colspan="2" align="center"><input type="button" value="注册" onclick="testPassword()/checkmobile()"/></td>
   				</tr>
   			</table>
   		</form>
    </div>

      </div>
  <div id="poweredby">
        <iframe id='updater' class='hidden' frameborder='0' width='100%' scrolling='no' allowtransparency='true' src="http://api.zentao.net/updater-isLatest-9.8.2-a1ded832a00a209a793a98040b49770d.html?lang=zh_cn"></iframe>
        <input type='hidden' name='verifyRand' id='verifyRand' value='611421168'  />
  </div>
</div>
<iframe frameborder='0' name='hiddenwin' id='hiddenwin' scrolling='no' class='debugwin hidden'></iframe>
<script language='Javascript'>startCron();
</script>
<script laguage='Javascript'>
/**
 * Switch account 
 * 
 * @param  string $account 
 * @param  string $method 
 * @access public
 * @return void
 */
$(document).ready(function()
{
    $('#dataform').submit(function()
    {
        var password = $('input#verifyPassword').val();
        var rand = $('input#verifyRand').val();
        $('input#verifyPassword').val(md5(md5(password) + rand));
    });
});

function switchAccount(account, method)
{
    if(method == 'dynamic')
    {
        link = createLink('user', method, 'period=' + period + '&account=' + account);
    }
    else if(method == 'todo')
    {
        link = createLink('user', method, 'account=' + account + '&type=' + type);
    }
    else
    {
        link = createLink('user', method, 'account=' + account);
    }
    location.href=link;
}

var mailsuffix = '';
var account    = new Array();
function setDefaultEmail(num)
{
    var mailValue = $('.email_' + num).val();
    if(mailValue.indexOf('@') <= 0) return;
    if(mailValue.indexOf('@') > 0) mailValue = mailValue.substr(mailValue.indexOf('@'));
    mailsuffix = mailValue;
}

function changeEmail(num)
{
    var mailValue = $('.email_' + num).val();
    if(mailsuffix != '' && (mailValue == '' || mailValue == account[num] + mailsuffix)) $('.email_' + num).val($('.account_' + num).val() + mailsuffix);
    account[num] = $('.account_' + num).val();
}

function checkPassword(password)
{
    $('#passwordStrength').html(password == '' ? '' : passwordStrengthList[computePasswordStrength(password)]);
    $('#passwordStrength').css('display', password == '' ? 'none' : 'table-cell');
}
// Prevent login page show in a iframe modal
if(window.self !== window.top) window.top.location.href = window.location.href;

function setForm(){}
$(document).ready(function()
{
    $('#account').focus();

    $("#langs li > a").click(function() 
    {
        selectLang($(this).data('value'));
    });

    var mBtn = $('#mobile');
    mBtn.popover({html: true, container: 'body'}).click(function(event)
    {
        event.stopPropagation();
        $(document).one('click', function(){$('#mobile').popover('hide');});
    });
    mBtn.attr('title', mBtn.attr('data-original-title'));
    $('#login-form form').submit(function()
    {
        var password = $('input:password').val();
        var rand = $('input#verifyRand').val();
        if(password.length != 32 && typeof(md5) == 'function') $('input:password').val(md5(md5(password) + rand));
    });
})
</script>
</body>
</html>

